#include "htf_context.h"
#include "../utils/htf_secure_mem.h"
#include <pthread.h>

struct htf_context {
    int backend_type;
    pthread_mutex_t lock;
};

htf_context_t* htf_context_create(int backend_type) {
    htf_context_t* ctx = (htf_context_t*)htf_secure_calloc(1, sizeof(htf_context_t));
    if (ctx) {
        ctx->backend_type = backend_type;
        pthread_mutex_init(&ctx->lock, NULL);
    }
    return ctx;
}

void htf_context_destroy(htf_context_t* ctx) {
    if (ctx) {
        pthread_mutex_destroy(&ctx->lock);
        htf_secure_free(ctx);
    }
}